<?php
/**
 * Created by PhpStorm.
 * User: mazhangyi
 * Date: 2020/1/10
 * Time: 16:39
 */

namespace app\api\controller\v1;
use app\api\controller\v1\common\Common;
use think\Controller;
use app\api\model\v1\Goods as goodsModel;
use think\Loader;


class Goods extends Common
{
   public function products(){
       $params = input('post.');
       $total = $params['currentNum'];
       $start = $params['start'];
       $res = goodsModel::displaygoods($start,$total);
       if(!$res){
           Common::toJson(0,'查询失败');
       }else{
           Common::toJson(200,'查询成功',$res);
       }
   }
   public function tryproducts(){
       $params = input('post.');
       $total = $params['currentNum'];
       $start = $params['start'];
       $res = goodsModel::trygoods($start,$total);
       if(!$res){
           Common::toJson(0,'查询失败');
       }else{
           Common::toJson(200,'查询成功',$res);
       }
   }
}